package com.daryl.bussiness.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.daryl.bussiness.service.PanDuanService;
import com.daryl.bussiness.service.impl.PanDuanServiceImpl;
import com.daryl.bussiness.vo.MessageVo;
import com.daryl.struts.aciton.Action;
import com.daryl.struts.form.ActionForm;

public class PanDuanAction implements Action {
	
	@Override
	public String execute(HttpServletRequest request, ActionForm form,
			Map<String, String> actionForward) {
		PanDuanService pan = new PanDuanServiceImpl();
		boolean bln = pan.panDuan(request.getParameter("username"));	
		String url = "";
		MessageVo mess = new MessageVo();
		if(bln){
			url = "success";
			mess.setName("success");
			mess.setMess("sssssssss");
		}else{
			url = "fail";
			mess.setName("fail");
			mess.setName("fffffffff");
		}
		request.setAttribute("mess", mess);
		return actionForward.get(url);
	}


	
	
}
